﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AAA.Meta.Quote.Data
{

#if !SILVERLIGHT
    [Serializable]
#endif
    public class BarData
    {
        private BarRecord _barRecord;

        public BarData() : this(new BarRecord()) {}

        public BarData(BarRecord barRecord)
        {
            _barRecord = barRecord;
        }

        public BarRecord ToBarRecord()
        {
            return _barRecord;
        }

        public string SymbolId
        {
            get { return _barRecord.SymbolId; }
            set { _barRecord.SymbolId = value; }
        }

        public DateTime BarDateTime
        {
            get { return _barRecord.BarDateTime; }
            set { _barRecord.BarDateTime = value; }
        }

        public BarCompressionEnum BarCompression
        {
            get { return _barRecord.BarCompression; }
            set { _barRecord.BarCompression = value; }
        }

        public int CompressionInterval
        {
            get { return _barRecord.CompressionInterval; }
            set { _barRecord.CompressionInterval = value; }
        }

        public float Open
        {
            get { return _barRecord.V0; }
            set { _barRecord.V0 = value; }
        }

        public float High        
        {
            get { return _barRecord.V1; }
            set { _barRecord.V1 = value; }
        }

        public float Low
        {
            get { return _barRecord.V2; }
            set { _barRecord.V2 = value; }
        }

        public float Close
        {
            get { return _barRecord.V3; }
            set { _barRecord.V3 = value; }
        }

        public float Volume
        {
            get { return _barRecord.V4; }
            set { _barRecord.V4 = value; }
        }

        public float Amount
        {
            get { return _barRecord.V5; }
            set { _barRecord.V5 = value; }
        }
 
    }
}
